package com.atguigu.eduservice.controller;

import com.atguigu.oss.commonutils.R;
import org.springframework.web.bind.annotation.*;

/**
 * @author luomingliang
 * @date 2020/6/3 21:30
 * 跨域问题: 两个访问地址中 协议,ip地址,端口号中有任何一个不同, 就称之为跨域
 */
@CrossOrigin  //解决跨域问题
@RequestMapping("/eduservice/user")
@RestController
public class EduLoginController {

    //login
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");
    }

    //info
    @GetMapping("info")
    public R info(){
        return R.ok().data("roles","[admin]")
                .data("name","admin")
                .data("avater","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }

}
